package com.yao.mall.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yao.mall.common.IdRequest;
import com.yao.mall.model.dto.GoodsSkuRequest;
import com.yao.mall.model.dto.goods.GoodsAddRequest;
import com.yao.mall.model.dto.goods.GoodsQueryRequest;
import com.yao.mall.model.dto.goods.GoodsRequest;
import com.yao.mall.model.dto.goods.HotGoodsRequest;
import com.yao.mall.model.entity.Goods;
import com.yao.mall.model.vo.GoodsBasicVO;
import com.yao.mall.model.vo.GoodsVO;

import java.util.List;


/**
* @author jiahua.yao
* @description 针对表【goods】的数据库操作Service
* @date 2024-03-07 16:45:19
*/
public interface GoodsService extends IService<Goods> {

    /**
     * 根据条件获取商品的基本信息
     *  @param goodsQueryRequest dto
     * @return list
     */
    Page<GoodsBasicVO> getGoodsBasic(GoodsQueryRequest goodsQueryRequest);

    /**
     * 修改商品上架状态
     * @param goodsRequest dto
     * @return boolean
     */
    Boolean changeStatusById(GoodsRequest goodsRequest);

    /**
     * 删除商品
     * @param id id
     * @return boolean
     */
    Boolean deleteGoods(Long id);

    /**
     * 查看商品具体详情
     * @param idRequest idRequest
     * @return GoodsVO
     */
    GoodsVO getGoodsDetails(IdRequest idRequest);

    /**
     * 增加商品
     * @param goodsAddRequest 商品添加dto
     * @return boolean
     */
    Boolean addGoods(GoodsAddRequest goodsAddRequest);

    /**
     * 将goods转为goodsBasicVO
     * @param goodsList 商品list
     * @return GoodsBasicVO
     */
    List<GoodsBasicVO> toGoodsBasicVO(List<Goods> goodsList);

    /**
     * 获取首页展示的商品
     * @return goodsBasicVO
     */
    List<GoodsBasicVO> getGoods();

    /**
     * 获取周热榜或日热榜商品信息
     * @param hotGoodsRequest dto
     * @return list
     */
    List<GoodsBasicVO> getHotGoods(HotGoodsRequest hotGoodsRequest);

    /**
     * 修改sku商品库存
     * @param goodsSkuRequest
     * @return
     */
    Boolean changeStockById(GoodsSkuRequest goodsSkuRequest);
}
